Polyscheme: a Semantics for a Concurrent Scheme 1 Current State of Scheme 2 Semantics of a Concurrent Scheme

نویسنده

  • Christian Queinnec
چکیده

The Scheme language does not fully specify the semantics of combination: the evaluation order of the terms composing a combination is left indeterminate. We investigate in this paper a diierent semantics for Scheme where terms of combinations are evaluated concurrently. The resulting semantics models a language with concurrent threads sharing a common workspace. The semantics is given in terms of denotational semantics and uses resumptions as well as a choice operator: oneof which mimics a scheduler. An alternate deenition for this operator lets appear the classical powerdomains. The main interest of this operator is to ooer a formalization that can be read with an operational point of view while keeping a rm theoretical base. Scheme also ooers rst class continuations with indeenite extent; we examine some semantics for continuations with respect to concurrency. Each of these semantics is a natural extension of the sequential case of regular Scheme. Still they strongly diier in their observed behaviours. The resulting language, named PolyScheme, ooers much of the features of current concurrent Lisp (or Scheme) dialects thanks to the sole extension of its combination semantics and without any explicit specialized construct dealing with concurrency. The Scheme language Rees & Clinger 86] does not specify the evaluation order of the terms of a combination i.e. application. The usual behaviour for Lisp-like languages is to evaluate terms from left to right due to the nature of lists which head is easily extracted. Clever compilers can improve the generated code if they can rearrange the computation of the arguments of the application provided that no side-eeects occur. Scheme goes further since not only the arguments of the application can be computed in whatever order but so can be the functional term. Moreover side-eeects must explicitely be sequentialized thanks to begin (or progn in Lisp). Nevertheless Scheme is always a sequential language since the body of a function is computed after its arguments. To say that the evaluation order is indeterminate only means that there exists a sequential evaluation order but it is left unspeciied. Thus one must not write code depending on it. This remark is crucial since the following Scheme program always returns true: (let ((x 1)) (car (list (equal? x x) (set! x 2)))) During the comparison, performed by equal?, the variable x is equal to 1 or 2 depending on the evaluation order but in any case will always be equal to itself. …

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Concurrent Interactive Processes in a Pure Functional Language

In this paper we present an operational semantics for concurrent interactive processes in the purely functional programming language Clean. An interactive process is in essence a state transition system which apart from its logical state can also access the state of the file system, do highlevel Graphical User I/O, and do inter-process communication via synchronous and asynchronous message pass...

متن کامل

Concurrent goal-based execution of Constraint Handling Rules

We introduce a systematic, concurrent execution scheme for Constraint Handling Rules (CHR) based on a previously proposed sequential goal-based CHR semantics. We establish strong correspondence results to the abstract CHR semantics, thus guaranteeing that any answer in the concurrent, goal-based CHR semantics is reproducible in the abstract CHR semantics. Our work provides the foundation to obt...

متن کامل

A Concurrent Operational Semantics for Constraint Functional Logic Programming

In this paper we describe a sound and complete concurrent operational semantics for constraint functional logic programming languages which allows to model declarative applications in which the interaction between demand-driven narrowing and constraint solving helps to prune the search space, leading to shorter goal derivations. We encode concurrency into the generic CFLP(D) scheme, a uniform f...

متن کامل

A Concurrent and Distributed Extension of Scheme

The Lisp family of languages has traditionally been a privileged domain where linguistic experiments were done, this paper presents a new dialect ooering concurrency and distribution. This dialect, nicknamed CD-Scheme, has been designed above Scheme with as few as possible features to allow a great expressiveness but still to retain the original consistency and simplicity of Scheme. We explicit...

متن کامل

Design of a Concurrent and Distributed Language

This paper presents a new dialect of Scheme aimed towards con-currency and distribution. It ooers a few primitives, including rst-class continuations , with very simple semantics. Numerous examples are given showing how to program the classical concurrent control operators such as future, pcall and either. The implementation is sketched and presented along the lines of a metacircular interprete...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1990